<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>平台币申请</title>
<!-- css 样式引入 -->
<link rel="stylesheet" type="text/css"
	href="../../css/bootstrap.min.css" />
<link rel="stylesheet" type="text/css"
	href="../../css/bootstrap-table.css" />
<link rel="stylesheet" type="text/css"
	href="../../css/bootstrap-datetimepicker.min.css" />
<link rel="stylesheet" type="text/css"
	href="../../css/font-awesome.min.css" />
<link rel="stylesheet" type="text/css" href="../../css/index.css">
<!-- js引入 -->
<script type="text/javascript" src="../../js/jquery.min.js"></script>
<script type="text/javascript" src="../../js/bootstrap.min.js"></script>
<script type="text/javascript" src="../../js/bootstrap-table.js"></script>
<script type="text/javascript" src="../../js/bootstrap-table-zh-CN.js"></script>
<script type="text/javascript"
	src="../../js/bootstrap-datetimepicker.js"></script>
<script type="text/javascript"
	src="../../js/bootstrap-datetimepicker.zh-CN.js"></script>
<script src="js/applyPlatCurrency.js"></script>
</head>
<body>
	<!-- 标题 -->
	<table class="btbHead">
		<!-- <tr>
			<td style="width:25%;"><i class="fa fa-align-justify"></i>&nbsp;平台币申请</td>
			<td style="text-align: right;">
				<a href="#" id="addBtn" class="btn btn-info"  onclick="add()" data-toggle="modal" data-target="#myModal"><i class="fa fa-plus"></i>&nbsp;添加</a>
			</td>
		</tr> -->
	</table>

	<!-- 模糊查询条件 -->
	<form role="form" class="form-inline searchForm">
		<div class="form-group">
			<label for="name">查询条件</label> <input type="text"
				class="form-control" id="keyWord" placeholder="请输入申请人用户名"
				style="width: 250px;"> <a href="javascript:doQuery()"
				class="btn btn-default"><i class="fa fa-search"></i></a>
		</div>
	</form>

	<div class="slideLine" style="margin-top: 10px; margin-bottom: 10px;"></div>

	<!-- 数据表格 -->
	<table data-toggle="table" id="dataTable" data-pagination="true">
		<thead>
			<tr>
				<th data-field="id" data-align="center">编号</th>
				<th data-field="userId">购买方ID</th>
				<th data-field="username">申请人用户名</th>
				<th data-field="type" data-formatter="auditTypeFormatter">申请类型</th>
				<th data-field="money">申请金额</th>
				<th data-field="applyTime" data-formatter="dateFormatter">提交时间</th>
				<th data-field="auditor">申请处理人</th>
				<th data-field="auditTime" data-formatter="dateFormatter">申请处理时间</th>
				<th data-field="auditResult" data-formatter="auditResultFormatter">申请结果</th>
				<th data-field="auditMessage">审核信息</th>
				<th data-field="state" data-formatter="auditFormatter">审核状态</th>
				<th data-field="opraite" data-formatter="operateFormatter">操作</th>
			</tr>
		</thead>
	</table>

	<!-- table 数据展示  end -->
	<!--审核模态框-->
	<div class="modal fade" id="auditModal" tabindex="-1" role="dialog"
		aria-labelledby="myModalLabel" aria-hidden="true">
		<div class="modal-dialog">
			<div class="modal-content">
				<div class="modal-header">
					<button type="button" class="close" data-dismiss="modal"
						aria-hidden="true">&times;</button>
					<h4 class="modal-title" id="myModalLabel">平台币申请审核</h4>
				</div>
				<div class="modal-body" id="iptBox">
					<form class="form-horizontal form-inline commitForm" role="form">
						<table width="100%">
							<tr>
								<td style="text-align: right; width: 19%;"><span>申请编号</span>
								</td>
								<td><input id="m_id" class="form-control" name="id"
									type="text" value="" style="width: 100%" readonly="true"></td>
								<td style="text-align: right; width: 19%;">用户ID</td>
								<td><input id="m_userId" class="form-control" name="userId"
									type="text" value="" style="width: 100%" readonly="true"></td>
							</tr>
							<tr>
								<td style="text-align: right; width:;"><span>申请人用户名</span>
								</td>
								<td><input id="m_username" class="form-control" type="text"
									value="" style="width: 100%" readonly="true"></td>
								<td style="text-align: right; width:;">申请类型</td>
								<td><input id="m_type" class="form-control" type="text"
									value="" style="width: 100%" readonly="true"></td>
							</tr>
							<tr>
								<td style="text-align: right;"><span>申请金额</span></td>
								<td><input id="m_money" class="form-control" type="text"
									value="money" style="width: 100%" readonly="true"></td>
								<td><span>提交时间</span></td>
								<td><span id="m_applyTime"></span></td>
							</tr>
							<tr>
								<td style="text-align: right;"><span>申请结果</span></td>
								<td colspan=""><select id="m_auditResult"
									class="form-control" name="auditResult">
										<option value="0">失败</option>
										<option value="1" selected="selected">成功</option>
								</select></td>
								<td style="text-align: right;"><span>审核信息</span></td>
								<td colspan=""><input id="m_auditMessage"
									class="form-control" name="auditMessage" type="text" value=""
									style="width: 100%"></td>
							</tr>
						</table>
					</form>
				</div>
				<div class="modal-footer">
					<button type="button" class="btn btn-default" data-dismiss="modal">取消
					</button>
					<button type="button" class="btn btn-primary" onclick="audit()">
						提交</button>
				</div>
			</div>
		</div>
	</div>
</body>

<script type="text/javascript">
	// 修改模态框监听
	$('#auditModal').on(
			'show.bs.modal',
			function(event) {
				var button = $(event.relatedTarget)
				var id = button.data('id')
				var money = button.data('money')
				var state = button.data('state') == 0 ? "已审核" : "未审核";
				var type = button.data('type') == 0 ? "提现" : "充值";
				var userId = button.data('userid')
				var username = button.data('username')
				var applyTime = button.data('applytime')
				var auditMessage = button.data('auditmessage')
				var auditResult = button.data('auditresult')
				var auditTime = button.data('audittime')
				var auditor = button.data('auditor')
				var modal = $(this)
				modal.find('#m_applyTime').text(
						new Date(applyTime).Format("yyyy-MM-dd"));
				modal.find('#m_auditMessage').val(auditMessage);
				modal.find('#m_auditResult').val(auditResult);
				modal.find('#m_auditTime').val(
						new Date(auditTime).Format("yyyy-MM-dd"));
				modal.find('#m_auditor').val(auditor);
				modal.find('#m_id').val(id);
				modal.find('#m_money').val(money);
				modal.find('#m_state').val(state);
				modal.find('#m_type').val(type);
				modal.find('#m_userId').val(userId);
				modal.find('#m_username').val(username);
			});
</script>
</html>